package org.jetlinks.pro.tenant;

import org.hswebframework.web.authorization.DimensionType;
import org.jetlinks.pro.assets.AssetBinding;
import org.jetlinks.pro.assets.AssetType;
import org.jetlinks.pro.tenant.dimension.TenantDimensionType;

import javax.annotation.Nonnull;

public interface TenantAsset extends AssetBinding {

    @Nonnull
    @Override
    default DimensionType getTargetType() {
        return TenantDimensionType.tenantMember;
    }

    @Nonnull
    @Override
    default String getTargetId() {
        return getTargetType().isSameType(TenantDimensionType.tenant) ? getTenantId() : getOwnerId();
    }

    String getTenantId();

    @Nonnull
    String getAssetId();

    @Nonnull
    AssetType getAssetType();

    String getOwnerId();

    long getPermissionValue();


}
